home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 149 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.7 KB

  1. Path: gate.net!not-for-mail
  2. From: feathers@gate.net (Michael Feathers)
  3. Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  4. Subject: Re: Hungarian notation
  5. Followup-To: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
  6. Date: 2 Jan 1996 14:50:58 -0500
  7. Organization: CyberGate, Inc.
  8. Message-ID: <4cc2b2$11jq@navajo.gate.net>
  9. References: <30C40F77.53B5@swsbbs.com> <marnoldDJEvtJ.1Lx@netcom.com> <4aleun$jlk@ns.RezoNet.NET> <marnoldDJMDBG.CFz@netcom.com> <4asnkr$7b0@solutions.solon.com> <4ath75$e7i@barnacle.iol.ie> <4b4kij$svt@news.microsoft.com> <dewar.819489496@schonberg> <4bd
  10. NNTP-Posting-Host: navajo.gate.net
  11. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  12.  
  13. 3ga$80a@beatty.slip.netcom.com> <30DC677A.5116@zeta.org.au>
  14. Distribution: 
  15.  
  16. Ross McKay (rosko@zeta.org.au) wrote:
  17. : Derek Lee Beatty wrote:
  18. : > [snip]
  19. : > Doesn't one of Halmos' classic essays on notation point out the power of
  20. : > conventions by suggesting the silly example of using epsilon to denote the
  21. : > number of elements we're processing, delta as a summation index, x as the
  22. : > dependent variable, y as an independent variable, i as a real number, and
  23. : > evaluating the limit as capital N approaches zero?  In other words, haven't
  24. : > mathematician been coding type information into variables for years,
  25. : > presumably because it is beneficial?
  26.  
  27. I have some very good real life experience with Hungarian notation.  Five
  28. years ago I implemented a compiler for an in-house programming language to
  29. be used by mathematicians and statisticians with little programming 
  30. experience.  In code reviews a few years ago, I and several other programmers
  31. suggested that the users of this programming language us a variant of
  32. Hungarian notation in order to aid their development.  The response
  33. was uniformly negative, we only barely got them to attempt it for 
  34. a trail period (with a little arm-twisting help from management).
  35.  
  36. Two years later, these programmers have flipped completely.  They 
  37. all love Hungarian notation now.  They've discovered that any convention
  38. is readable as long as it is consistent and logical.  In addition, they've
  39. found it invaluable in debugging ans system maintenance.
  40.  
  41. In my experience, the people who don't care for Hungarian simply haven't
  42. bitten the bullet long enough to get the long term payoff.
  43.  
  44. : ...and now, three months later, I see the error of my ways, and choose to 
  45. : change everything to long integer arithmetic, as there will never be a 
  46. : fractional component to this problem.
  47.  
  48. Come now, how often does -that- happen?
  49.  
  50. : IMHO, what HN sets out to achieve is successful when taken only to *purpose* of 
  51. : object, not down to the level of *type*. e.g. indexNAME_OF_OBJECT, ptrPTR_TO_OBJECT,
  52. : etc. are useful, but lpszPTR_TO_OBJECT goes too far, locking semantic information
  53. : into the name when your program statements already provide this info.
  54. : Good OO implementations help to overcome the perceived need for "telling the 
  55. : programmer what type operations are needed at each step" (the only reason I can 
  56. : see for the obscene forms of HN used by M$ et al), by providing operator
  57. : overloading etc.
  58.  
  59. Where I work, all the truly portable code is written in terms of 
  60. typedefs.  We alter the typedefs in an include file to alter data
  61. sizes and performance characeristic, and our variant of Hungarian
  62. uses these type names.
  63.  
  64. These scheme has saved our butt numerous times.  The same code runs
  65. in legacy embedded systems and under 32-bit NT with data sizes
  66. appropriate to the architecture.
  67.  
  68.  
  69. ===========================================================================
  70. "Make'em all inlines and let the compiler sort them out!" - anonymous
  71.  
  72.